package gui;

import java.util.ArrayList;
import java.util.ListIterator;

public class ListOfPerson {

	private static ArrayList<Person> listOfPeoples;

	private static ArrayList<Person> liftOfZombies;

	public ListOfPerson() {
		listOfPeoples = new ArrayList<Person>();
		liftOfZombies = new ArrayList<Person>();

		ListOfPerson.addNpersons(Sliders.PEOPLES_AT_BEGINN, ListOfPerson.getPeoplesList());
		ListOfPerson.addNpersons(Sliders.ZOMBIES_AT_BEGINN, ListOfPerson.getLiftOfZombies());

	}

	protected static void addNpersons(int n, ArrayList<Person> whichPerson) {

		ListIterator<Person> litr = whichPerson.listIterator();
		for (int i = 0; i < n; i++) {
			litr.add(new Person());

		}
	}

	protected static void removeNpersons(int n, ArrayList<Person> whichPerson) {
		ListIterator<Person> litr = whichPerson.listIterator();
		for (int i = 0; i < n; i++) {
			if (litr.hasNext()) {
				litr.next();
				litr.remove();
			}

		}
	}

	// Getter und Setter
	public static ArrayList<Person> getPeoplesList() {
		return listOfPeoples;
	}

	public static void setPeoplesList(ArrayList<Person> listOfPeoples) {
		ListOfPerson.listOfPeoples = listOfPeoples;
	}

	public static ArrayList<Person> getLiftOfZombies() {
		return liftOfZombies;
	}

	public static void setLiftOfZombies(ArrayList<Person> liftOfZombies) {
		ListOfPerson.liftOfZombies = liftOfZombies;
	}

}
